<template>
  <div>
    <ul style='width: 150px;height: 150px;'>
          <li v-for="item in list" :key="item.id" @click="xinaq">
            <img :src="item.image" alt="">
            <span>{{ item.title }}</span>
            <span>{{ item.price }}</span>
          </li>
        </ul>
  </div>
</template>

<script setup>
import request from "@/uitle/request";
import router from "@/router";
import { ref } from "vue";
const list = ref([]);
request.get("/list", {
    params: { pagination: 1, pageNum: 30 },
  })
  .then((res) => {
    if(res.data.code==200){
        // console.log(res);
        list.value=res.data.data
    }
  });
  const xinaq = () => {
    router.push('/detail')
  }

</script>

<style lang="scss" scoped>

</style>